package com.example.dao;

import com.example.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserDao {
    // 根据UID查询用户
    User findById(int uid);
    List<User> findAll();
    int insert(User user);
    int update(User user);
    int delete( Integer uid);
    User findByNameAndPassword(@Param("username") String username,
                               @Param("password") String password);

    List<User> searchByUsername(@Param("username") String username);

    User findByAuthor(String author);

    // 通过uid修改信息
    User findByUid( Integer uid);
    int updateScore(@Param("uid") int uid,@Param("score") int score);
}
